package org.hitchhike.core.utils;

import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;

public class PageableUtil {

  public static Pageable getPageable(Integer page, Integer size) {
    if (page == null || page <= 0) {
      page = 1;
    }
    Pageable pageable = new PageRequest(page - 1, size);
    return pageable;
  }
}
